package com.hongning.railway.entity;


import android.databinding.InverseMethod;

import com.hongning.railway.util.TimeUtils;

import java.util.List;

/**
 * 后台返回的信息太乱了
 */
public class LoginEntity {


    /**
     * auths : [{"authId":"101","authName":"后台子系统","moduleId":"1","roleId":"999"}]
     * groups : [{"groupid":"101001","groupname":"机关第一党支部"}]
     * roles : [{"roleid":"999","rolename":"admin","staffid":"admin"}]
     * token : Bearer eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE1NjU3MDg4MjEsInN1YiI6ImFkbWluIiwiY3JlYXRlZCI6MTU2NTYyMjQyMTcyOH0.b63vXER1AERsdC1CXl9fO3yic-E3Z9SZ9bin1eLAFxvRuiKBOJkJj2nJBpa1xYxxs6LAqwdqt_UlG4_YEygNrA
     * userExtendInfo : {"age":28,"birthday":1565568000000,"dimissiondate":1566638662000,"domiciledplace":"西安市","education":"420518","graduatedate":1565601634000,"idcardcode":"1231214324","ismarried":"42","joindate":1565601836000,"joinlen":3,"joinpartydate":1565601600000,"major":"计算机","nation":"汉族","nativeplace":"陕西","politicalstanding":"420521","sex":"4050000","staffid":"admin","telno":"420518","university":"北大"}
     * userName : admin
     * userinfo : {"dlevelId":"aaaa","dutyId":"001","orgName":"牵引变电所","orgaId":"101018005","postId":"001","postname":"技术员","staffId":"admin","staffIdStatus":"02","staffName":"admin","staffState":"0"}
     */

    private String token;
    private UserExtendInfoBean userExtendInfo;
    private String userName;
    private UserinfoBean userinfo;
    private List<AuthsBean> auths;
    private List<GroupsBean> groups;
    private List<RolesBean> roles;

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public UserExtendInfoBean getUserExtendInfo() {
        return userExtendInfo;
    }

    public void setUserExtendInfo(UserExtendInfoBean userExtendInfo) {
        this.userExtendInfo = userExtendInfo;
    }


    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public UserinfoBean getUserinfo() {
        return userinfo;
    }

    public void setUserinfo(UserinfoBean userinfo) {
        this.userinfo = userinfo;
    }

    public List<AuthsBean> getAuths() {
        return auths;
    }

    public void setAuths(List<AuthsBean> auths) {
        this.auths = auths;
    }

    public List<GroupsBean> getGroups() {
        return groups;
    }

    public void setGroups(List<GroupsBean> groups) {
        this.groups = groups;
    }

    public List<RolesBean> getRoles() {
        return roles;
    }

    public void setRoles(List<RolesBean> roles) {
        this.roles = roles;
    }

    public static class UserExtendInfoBean {
        /**
         * age : 28
         * birthday : 1565568000000
         * dimissiondate : 1566638662000
         * domiciledplace : 西安市
         * education : 420518
         * graduatedate : 1565601634000
         * idcardcode : 1231214324
         * ismarried : 42
         * joindate : 1565601836000
         * joinlen : 3
         * joinpartydate : 1565601600000
         * major : 计算机
         * nation : 汉族
         * nativeplace : 陕西
         * politicalstanding : 420521
         * sex : 4050000
         * staffid : admin
         * telno : 420518
         * university : 北大
         */

        private int age;
        private long birthday;
//        android:text="@={partymemberinfoviewModel.loginEntity.userExtendInfo.birthday}"
        private long dimissiondate;
        private String domiciledplace;
        private String education;
        private long graduatedate;
        private String idcardcode;
        private String ismarried;
        private long joindate;
        private int joinlen;
        private long joinpartydate;
//        android:text="@={partymemberinfoviewModel.loginEntity.userExtendInfo.joinpartydate}"
        private String major;
        private String nation;
        private String nativeplace;
        private String politicalstanding;//政治面貌 	420520：团员,420521：党员,420522：预备党员,420523：群众
        private String sex;
        private String staffid;
        private String telno;
        private String university;

        public int getAge() {
            return age;
        }

        public void setAge(int age) {
            this.age = age;
        }

        public Long getBirthday() {
            return birthday ;
        }

        public void setBirthday(String birthday) {
            this.birthday = TimeUtils.StrToLong(birthday);
        }

        public long getDimissiondate() {
            return dimissiondate;
        }

        public void setDimissiondate(long dimissiondate) {
            this.dimissiondate = dimissiondate;
        }

        public String getDomiciledplace() {
            return domiciledplace;
        }

        public void setDomiciledplace(String domiciledplace) {
            this.domiciledplace = domiciledplace;
        }

        public String getEducation() {
            return education;
        }

        public void setEducation(String education) {
            this.education = education;
        }

        public long getGraduatedate() {
            return graduatedate;
        }

        public void setGraduatedate(long graduatedate) {
            this.graduatedate = graduatedate;
        }

        public String getIdcardcode() {
            return idcardcode;
        }

        public void setIdcardcode(String idcardcode) {
            this.idcardcode = idcardcode;
        }

        public String getIsmarried() {
            return ismarried;
        }

        public void setIsmarried(String ismarried) {
            this.ismarried = ismarried;
        }

        public long getJoindate() {
            return joindate;
        }

        public void setJoindate(long joindate) {
            this.joindate = joindate;
        }

        public int getJoinlen() {
            return joinlen;
        }

        public void setJoinlen(int joinlen) {
            this.joinlen = joinlen;
        }

        public Long getJoinpartydate() {
            return  joinpartydate;
        }

        public void setJoinpartydate(String joinpartydate) {
            this.joinpartydate =  TimeUtils.StrToLong(joinpartydate);
        }

        public String getMajor() {
            return major;
        }

        public void setMajor(String major) {
            this.major = major;
        }

        public String getNation() {
            return nation;
        }

        public void setNation(String nation) {
            this.nation = nation;
        }

        public String getNativeplace() {
            return nativeplace;
        }

        public void setNativeplace(String nativeplace) {
            this.nativeplace = nativeplace;
        }

        public String getPoliticalstanding() {
//            420520：团员,420521：党员,420522：预备党员,420523：群众
            if (politicalstanding.equals("420520"))
            {
                return "团员";
            }else  if (politicalstanding.equals("420521"))
            {
                return "党员";
            }else  if (politicalstanding.equals("420522"))
            {
                return "预备党员";
            }else {
                return "群众";
            }

        }

        public void setPoliticalstanding(String politicalstanding) {
            if (politicalstanding.equals("团员"))
            {
                this.politicalstanding = "420520";
            }else  if (politicalstanding.equals("党员"))
            {
                this.politicalstanding = "420521";
            }else  if (politicalstanding.equals("预备党员"))
            {
                this.politicalstanding = "420522";
            }else {
                this.politicalstanding = "420523";
            }

        }

        public String getSex() {
            if (sex.equals("4050000")){
                return "男";
            }else {
                return "女";
            }
        }

        public void setSex(String sex) {
            if (sex.equals("男")){
                this.sex = "4050000";
            }else {
                this.sex = "4050001";
            }

        }

        public String getStaffid() {
            return staffid;
        }

        public void setStaffid(String staffid) {
            this.staffid = staffid;
        }

        public String getTelno() {
            return telno;
        }

        public void setTelno(String telno) {
            this.telno = telno;
        }

        public String getUniversity() {
            return university;
        }

        public void setUniversity(String university) {
            this.university = university;
        }

    }

    public static class UserinfoBean {
        /**
         * dlevelId : aaaa
         * dutyId : 001
         * orgName : 牵引变电所
         * orgaId : 101018005
         * postId : 001
         * postname : 技术员
         * staffId : admin
         * staffIdStatus : 02
         * staffName : admin
         * staffState : 0
         */

        private String dlevelId;
        private String dutyId;
        private String orgName;
        private String orgaId;
        private String postId;
        private String postname;
        private String staffId;
        private String staffIdStatus;
        private String staffName;
        private String staffState;

        public String getDlevelId() {
            return dlevelId;
        }

        public void setDlevelId(String dlevelId) {
            this.dlevelId = dlevelId;
        }

        public String getDutyId() {
            return dutyId;
        }

        public void setDutyId(String dutyId) {
            this.dutyId = dutyId;
        }

        public String getOrgName() {
            return orgName;
        }

        public void setOrgName(String orgName) {
            this.orgName = orgName;
        }

        public String getOrgaId() {
            return orgaId;
        }

        public void setOrgaId(String orgaId) {
            this.orgaId = orgaId;
        }

        public String getPostId() {
            return postId;
        }

        public void setPostId(String postId) {
            this.postId = postId;
        }

        public String getPostname() {
            return postname;
        }

        public void setPostname(String postname) {
            this.postname = postname;
        }

        public String getStaffId() {
            return staffId;
        }

        public void setStaffId(String staffId) {
            this.staffId = staffId;
        }

        public String getStaffIdStatus() {
            return staffIdStatus;
        }

        public void setStaffIdStatus(String staffIdStatus) {
            this.staffIdStatus = staffIdStatus;
        }

        public String getStaffName() {
            return staffName;
        }

        public void setStaffName(String staffName) {
            this.staffName = staffName;
        }

        public String getStaffState() {
            return staffState;
        }

        public void setStaffState(String staffState) {
            this.staffState = staffState;
        }
    }

    public static class AuthsBean {
        /**
         * authId : 101
         * authName : 后台子系统
         * moduleId : 1
         * roleId : 999
         */

        private String authId;
        private String authName;
        private String moduleId;
        private String roleId;

        public String getAuthId() {
            return authId;
        }

        public void setAuthId(String authId) {
            this.authId = authId;
        }

        public String getAuthName() {
            return authName;
        }

        public void setAuthName(String authName) {
            this.authName = authName;
        }

        public String getModuleId() {
            return moduleId;
        }

        public void setModuleId(String moduleId) {
            this.moduleId = moduleId;
        }

        public String getRoleId() {
            return roleId;
        }

        public void setRoleId(String roleId) {
            this.roleId = roleId;
        }
    }

    public static class GroupsBean {
        /**
         * groupid : 101001
         * groupname : 机关第一党支部
         */

        private String groupid;
        private String groupname;

        public String getGroupid() {
            return groupid;
        }

        public void setGroupid(String groupid) {
            this.groupid = groupid;
        }

        public String getGroupname() {
            return groupname;
        }

        public void setGroupname(String groupname) {
            this.groupname = groupname;
        }
    }

    public static class RolesBean {
        /**
         * roleid : 999
         * rolename : admin
         * staffid : admin
         */

        private String roleid;
        private String rolename;
        private String staffid;

        public String getRoleid() {
            return roleid;
        }

        public void setRoleid(String roleid) {
            this.roleid = roleid;
        }

        public String getRolename() {
            return rolename;
        }

        public void setRolename(String rolename) {
            this.rolename = rolename;
        }

        public String getStaffid() {
            return staffid;
        }

        public void setStaffid(String staffid) {
            this.staffid = staffid;
        }
    }
}
